﻿<UserControl x:Class="Majesty_of_Omega.GUI.Pages.Game.Research.Parts.TechMatrixApplicationPart"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Majesty_of_Omega_ValueConverters="clr-namespace:Majesty_of_Omega.GUI.ValueConverters"
    xmlns:Parts="clr-namespace:Majesty_of_Omega.GUI.Pages.Game.Research.Parts"
    x:Name="ThisControl" 
    >
    <UserControl.Resources>
        <Majesty_of_Omega_ValueConverters:TechIconToImageConverter x:Key="TechIconToImageConverter"/>
        <LinearGradientBrush x:Key="UnknownTechBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF31313B" Offset="0.01"/>
            <GradientStop Color="#FF28282F" Offset="0.96"/>
            <GradientStop Color="#FF767783" Offset="0.72"/>
            <GradientStop Color="#FF767783" Offset="0.72"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="InResearchTechBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF5E5B02" Offset="0.015"/>
            <GradientStop Color="#FF3D3D01" Offset="0.97"/>
            <GradientStop Color="#FFD0CA2F" Offset="0.725"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ResearchedTechBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FF0F4516" Offset="0.013"/>
            <GradientStop Color="#FF1A5B04" Offset="0.973"/>
            <GradientStop Color="#FF32F249" Offset="0.777"/>
        </LinearGradientBrush>
        <Style TargetType="Parts:TechMatrixApplicationPart">
            <Style.Triggers>
                <Trigger Property="ResearchState" Value="Unknown">
                    <Setter Property="BorderBackground" Value="{StaticResource UnknownTechBrush}" />
                </Trigger>
                <Trigger Property="ResearchState" Value="Available">
                    <Setter Property="BorderBackground" Value="{StaticResource InResearchTechBrush}" />
                </Trigger>
                <Trigger Property="ResearchState" Value="InResearch">
                    <Setter Property="BorderBackground" Value="{StaticResource InResearchTechBrush}" />
                </Trigger>
                <Trigger Property="ResearchState" Value="Researched">
                    <Setter Property="BorderBackground" Value="{StaticResource ResearchedTechBrush}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Border x:Name="TechAppBorder" Width="Auto" Height="45" VerticalAlignment="Center" CornerRadius="4,4,4,4" BorderBrush="#FFE2C5C5" BorderThickness="1,1,1,1" HorizontalAlignment="Stretch" Margin="0,4,0,4" 
            Background="{StaticResource UnknownTechBrush}">
        <Grid Width="Auto" Height="Auto" Background="{x:Null}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="58.918"/>
                <ColumnDefinition Width="0*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Image Source="{Binding Path=TechApplication.IconName, Converter={StaticResource TechIconToImageConverter}, Mode=Default}" Margin="4,4,3.014,4"  />
            <TextBlock VerticalAlignment="Center" Height="Auto" Foreground="#FFFFFFFF" TextWrapping="Wrap" Text="{Binding Mode=OneWay}" Margin="0,0,0,0" HorizontalAlignment="Left" Grid.Column="2"/>
        </Grid>
    </Border>
</UserControl>
